/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package scanner;

import structures.table.symboltable.TerminalItemInfo;

/**
 *
 * @author Vlad
 */
public class Token {

    private TerminalItemInfo info;
    private int row;
    private int col;

    public Token(TerminalItemInfo info, int row, int col) {
        this.info = info;
        this.row = row;
        this.col = col;
    }

    public int getCol() {
        return col;
    }

    public TerminalItemInfo getInfo() {
        return info;
    }

    public int getRow() {
        return row;
    }

    @Override
    public String toString() {
        return "Token{" + "info=" + info + ", row=" + row + ", col=" + col + '}';
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Token other = (Token) obj;
        if (this.info != other.info && (this.info == null || !this.info.equals(other.info))) {
            return false;
        }
        if (this.row != other.row) {
            return false;
        }
        if (this.col != other.col) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 67 * hash + (this.info != null ? this.info.hashCode() : 0);
        hash = 67 * hash + this.row;
        hash = 67 * hash + this.col;
        return hash;
    }
}
